package com.ruoyi.web.controller.comlbs;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.request.bigscreen.AlarmStatisticsParam;
import com.ruoyi.system.domain.request.bigscreen.AvgOnlineRateParam;
import com.ruoyi.system.domain.request.bigscreen.PhotoStatisticsParam;
import com.ruoyi.system.service.BigScreenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 描述 大屏Controller
 * 作者 ZhangPing
 * 创建时间 2023/9/26 16:04
 */
@RestController
@RequestMapping("/comlbs/home")
public class HomeController extends BaseController {

    @Autowired
    private BigScreenService bigScreenService;

    @ApiOperation("设备统计")
    @PostMapping("/deviceStatistics")
    public AjaxResult deviceStatistics(@Validated @RequestBody AvgOnlineRateParam param){
        return success(bigScreenService.deviceStatistics(param));
    }

    @ApiOperation("设备里程排行")
    @PostMapping("/deviceMileageRank")
    public AjaxResult deviceMileageRank(@Validated @RequestBody AvgOnlineRateParam param){
        return success(bigScreenService.deviceMileageRank(param));
    }

    @ApiOperation("拍摄照片")
    @PostMapping("/photoStatistics")
    public AjaxResult photoStatistics(@Validated @RequestBody PhotoStatisticsParam param) {
        return success(bigScreenService.photoStatistics(param));
    }

    @ApiOperation("报警统计")
    @PostMapping("/alarmStatistics")
    public AjaxResult alarmStatistics(@Validated @RequestBody AlarmStatisticsParam param) {
        return success(bigScreenService.alarmStatistics(param));
    }
}
